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

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

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

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

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

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

f = A("f")
k = B("k")
b = C("b")
n = D("n")
l = E("l")
e = F("e")
i = C("i")
d = A("d")
m = B("m")
j = E("j")

f.p = b
f.x = n
f.q = n
f.w = d
k.u = f
k.p = n
b.p = f
b.s = k
b.w = k
n.o = k
n.w = f
n.z = b
n.t = i
n.v = e
l.r = k
l.s = j
l.p = e
e.u = k
e.t = b
e.v = n
e.s = f
e.w = l
i.p = f
i.s = m
i.w = m
d.p = i
d.x = n
d.q = n
d.w = f
m.u = f
m.p = n
j.r = k
j.s = l
j.p = e
assert k.u.w.p.p.p.p.w.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: D = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

f = A("f")
k = B("k")
b = C("b")
n = D("n")
l = E("l")
e = F("e")
i = C("i")
d = A("d")
m = B("m")
j = E("j")

f.p = b
f.x = n
f.q = n
f.w = d
k.u = f
k.p = n
b.p = f
b.s = k
b.w = k
n.o = k
n.w = f
n.z = b
n.t = i
n.v = e
l.r = k
l.s = j
l.p = e
e.u = k
e.t = b
e.v = n
e.s = f
e.w = l
i.p = f
i.s = m
i.w = m
d.p = i
d.x = n
d.q = n
d.w = f
m.u = f
m.p = n
j.r = k
j.s = l
j.p = e
assert k.u.w.p.p.p.p.w.w.p.txt == "b"