class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.p: D = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

l.o = h
l.u = h
l.q = j
j.o = k
j.x = m
h.z = i
h.u = i
h.q = l
h.w = l
e.q = k
e.w = i
e.x = n
f.t = k
f.x = n
i.w = l
i.r = l
i.p = n
i.s = n
i.o = n
m.t = k
m.x = e
k.z = i
k.u = i
k.q = l
k.w = l
c.w = l
c.r = l
c.p = e
c.s = e
c.o = e
n.q = h
n.w = i
n.x = e
assert i.s.w.r.u.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: F = None
        self.x: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: A = None
        self.p: D = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

l.o = h
l.u = h
l.q = j
j.o = k
j.x = m
h.z = i
h.u = i
h.q = l
h.w = l
e.q = k
e.w = i
e.x = n
f.t = k
f.x = n
i.w = l
i.r = l
i.p = n
i.s = n
i.o = n
m.t = k
m.x = e
k.z = i
k.u = i
k.q = l
k.w = l
c.w = l
c.r = l
c.p = e
c.s = e
c.o = e
n.q = h
n.w = i
n.x = e
assert i.s.w.r.u.q.o.txt == "h"