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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: F = None
        self.s: F = None
        self.t: C = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.r: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: F = None
        self.s: F = None
        self.t: C = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: F = None
        self.r: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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