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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.u = l
j.q = c
j.o = c
l.u = n
n.p = m
n.u = d
n.x = h
n.q = h
h.v = n
h.p = d
h.q = d
h.w = l
h.y = c
d.s = l
d.o = j
d.t = m
d.z = n
m.r = l
m.y = l
m.t = n
c.u = l
c.q = j
c.o = j
assert j.u.u.q.p.z.txt == "n"