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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

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

d.u = h
d.y = n
h.t = f
h.z = m
h.w = a
h.u = e
h.o = n
a.o = f
a.w = d
j.q = h
j.u = h
c.s = l
c.q = l
c.o = l
e.w = n
e.p = j
f.q = h
f.u = h
l.s = c
l.q = c
l.o = c
n.u = h
n.y = d
m.o = j
m.w = n
assert d.u.o.u.u.p.txt == "j"