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

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

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

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

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

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

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

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

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

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

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

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

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