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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: F = None
        self.u: E = None
        self.r: C = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: F = None
        self.u: E = None
        self.r: C = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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