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

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: F = None
        self.p: F = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: E = None
        self.z: A = None
        self.txt = txt

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

c = A("c")
g = B("g")
f = C("f")
m = D("m")
n = E("n")
j = F("j")
i = A("i")
h = C("h")
d = F("d")
e = E("e")

c.q = f
c.t = g
c.r = d
c.p = m
g.z = j
g.t = m
g.s = n
g.p = h
f.r = g
f.x = m
f.u = h
m.x = h
m.r = d
m.p = j
m.y = i
m.w = n
n.u = i
n.z = i
n.w = e
j.p = g
j.t = g
j.y = h
j.x = m
j.r = f
i.q = f
i.t = g
i.r = d
i.p = m
h.r = g
h.x = m
h.u = f
d.p = g
d.t = g
d.y = h
d.x = m
d.r = f
e.u = i
e.w = n
e.z = c
assert c.p.y.r.t.p.x.r.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.r: F = None
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: F = None
        self.p: F = None
        self.y: A = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: E = None
        self.z: A = None
        self.txt = txt

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

c = A("c")
g = B("g")
f = C("f")
m = D("m")
n = E("n")
j = F("j")
i = A("i")
h = C("h")
d = F("d")
e = E("e")

c.q = f
c.t = g
c.r = d
c.p = m
g.z = j
g.t = m
g.s = n
g.p = h
f.r = g
f.x = m
f.u = h
m.x = h
m.r = d
m.p = j
m.y = i
m.w = n
n.u = i
n.z = i
n.w = e
j.p = g
j.t = g
j.y = h
j.x = m
j.r = f
i.q = f
i.t = g
i.r = d
i.p = m
h.r = g
h.x = m
h.u = f
d.p = g
d.t = g
d.y = h
d.x = m
d.r = f
e.u = i
e.w = n
e.z = c
assert c.p.y.r.t.p.x.r.r.u.txt == "h"