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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: A = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.q: A = None
        self.y: C = None
        self.w: A = None
        self.txt = txt

k = A("k")
f = B("f")
d = C("d")
h = D("h")
b = E("b")
l = F("l")
c = C("c")
g = D("g")
n = F("n")
j = E("j")

k.p = d
k.z = d
k.q = f
k.t = f
k.w = b
f.z = h
d.x = k
h.x = k
h.u = k
h.z = l
h.s = l
h.t = f
b.z = l
b.p = k
b.u = d
b.t = c
l.t = g
l.o = j
l.q = k
l.w = k
l.y = d
c.x = k
g.x = k
g.u = k
g.z = l
g.s = l
g.t = f
n.t = g
n.o = j
n.q = k
n.w = k
n.y = d
j.z = l
j.p = k
j.u = d
j.t = d
assert b.p.w.z.o.z.o.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.z: C = None
        self.w: E = None
        self.t: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: A = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.q: A = None
        self.y: C = None
        self.w: A = None
        self.txt = txt

k = A("k")
f = B("f")
d = C("d")
h = D("h")
b = E("b")
l = F("l")
c = C("c")
g = D("g")
n = F("n")
j = E("j")

k.p = d
k.z = d
k.q = f
k.t = f
k.w = b
f.z = h
d.x = k
h.x = k
h.u = k
h.z = l
h.s = l
h.t = f
b.z = l
b.p = k
b.u = d
b.t = c
l.t = g
l.o = j
l.q = k
l.w = k
l.y = d
c.x = k
g.x = k
g.u = k
g.z = l
g.s = l
g.t = f
n.t = g
n.o = j
n.q = k
n.w = k
n.y = d
j.z = l
j.p = k
j.u = d
j.t = d
assert b.p.w.z.o.z.o.p.w.txt == "b"