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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

g = A("g")
m = B("m")
e = C("e")
i = D("i")
c = E("c")
k = A("k")
j = D("j")
n = D("n")
a = C("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

g = A("g")
m = B("m")
e = C("e")
i = D("i")
c = E("c")
k = A("k")
j = D("j")
n = D("n")
a = C("a")

g.v = k
g.x = m
g.u = e
g.t = c
g.s = c
m.y = a
m.p = n
m.r = c
m.z = c
m.q = c
e.t = m
e.r = m
e.s = j
e.y = k
e.w = k
i.w = c
c.u = m
k.v = g
k.x = m
k.u = a
k.t = c
k.s = c
j.w = c
n.w = c
a.t = m
a.r = m
a.s = j
a.y = g
a.w = g
assert n.w.u.r.u.r.u.y.s.w.txt == "c"