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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.r: F = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.r: F = None
        self.t: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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