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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

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

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