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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.w: D = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

h = A("h")
c = B("c")
f = C("f")
k = D("k")
b = E("b")
i = F("i")
d = E("d")
g = A("g")
m = E("m")

h.p = k
h.t = f
c.t = k
c.y = k
c.q = g
f.u = m
f.v = k
f.q = b
f.z = i
k.u = d
k.t = c
k.w = i
k.r = i
k.z = i
k.x = h
b.p = d
b.o = c
b.w = k
b.r = k
b.q = k
i.u = c
i.p = f
i.v = d
i.x = h
d.p = b
d.o = c
d.w = k
d.r = k
d.q = k
g.p = k
g.t = f
m.p = d
m.o = c
m.w = k
m.r = k
m.q = k
assert b.q.u.p.w.z.u.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.w: D = None
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

h = A("h")
c = B("c")
f = C("f")
k = D("k")
b = E("b")
i = F("i")
d = E("d")
g = A("g")
m = E("m")

h.p = k
h.t = f
c.t = k
c.y = k
c.q = g
f.u = m
f.v = k
f.q = b
f.z = i
k.u = d
k.t = c
k.w = i
k.r = i
k.z = i
k.x = h
b.p = d
b.o = c
b.w = k
b.r = k
b.q = k
i.u = c
i.p = f
i.v = d
i.x = h
d.p = b
d.o = c
d.w = k
d.r = k
d.q = k
g.p = k
g.t = f
m.p = d
m.o = c
m.w = k
m.r = k
m.q = k
assert b.q.u.p.w.z.u.q.p.txt == "k"