Implement basic missing distance guessing and writing result to stdout