class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: B = None
        self.r: E = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.u: F = None
        self.s: F = None
        self.z: B = None
        self.y: F = None
        self.txt = txt

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

i = A("i")
h = B("h")
d = C("d")
j = D("j")
e = E("e")
c = F("c")
m = E("m")

i.q = j
i.t = h
i.o = h
i.r = m
i.p = e
h.o = m
h.r = e
d.t = j
d.u = j
d.r = h
j.o = c
j.x = c
e.q = c
e.u = c
e.s = c
e.y = c
e.o = m
e.z = h
c.t = i
m.q = c
m.u = c
m.s = c
m.y = c
m.o = e
m.z = h
assert m.z.o.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: B = None
        self.r: E = None
        self.o: B = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.u: F = None
        self.s: F = None
        self.z: B = None
        self.y: F = None
        self.txt = txt

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

i = A("i")
h = B("h")
d = C("d")
j = D("j")
e = E("e")
c = F("c")
m = E("m")

i.q = j
i.t = h
i.o = h
i.r = m
i.p = e
h.o = m
h.r = e
d.t = j
d.u = j
d.r = h
j.o = c
j.x = c
e.q = c
e.u = c
e.s = c
e.y = c
e.o = m
e.z = h
c.t = i
m.q = c
m.u = c
m.s = c
m.y = c
m.o = e
m.z = h
assert m.z.o.q.t.txt == "i"