class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: D = None
        self.t: F = None
        self.o: E = None
        self.z: A = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

i = A("i")
a = B("a")
f = C("f")
c = D("c")
l = E("l")
k = F("k")
b = E("b")
n = F("n")
e = D("e")
h = B("h")

i.o = n
i.q = c
a.u = b
f.s = c
c.u = i
c.z = i
c.y = i
c.v = e
c.t = n
c.o = b
l.z = a
k.u = n
b.z = h
n.u = k
e.u = i
e.z = i
e.y = i
e.v = c
e.t = k
e.o = b
h.u = b
assert f.s.o.z.u.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: D = None
        self.t: F = None
        self.o: E = None
        self.z: A = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

i = A("i")
a = B("a")
f = C("f")
c = D("c")
l = E("l")
k = F("k")
b = E("b")
n = F("n")
e = D("e")
h = B("h")

i.o = n
i.q = c
a.u = b
f.s = c
c.u = i
c.z = i
c.y = i
c.v = e
c.t = n
c.o = b
l.z = a
k.u = n
b.z = h
n.u = k
e.u = i
e.z = i
e.y = i
e.v = c
e.t = k
e.o = b
h.u = b
assert f.s.o.z.u.z.u.z.txt == "h"