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

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

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

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

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

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

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

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

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

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

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

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

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

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

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