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

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

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

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

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

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

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

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

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

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

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

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

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