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

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.w: B = None
        self.p: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: C = None
        self.w: B = None
        self.p: E = None
        self.q: B = None
        self.txt = txt

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

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

m.y = i
m.s = k
g.p = b
g.t = c
h.v = m
h.p = a
h.o = n
j.v = b
j.u = h
j.w = g
j.q = g
j.p = c
c.u = j
c.t = i
c.v = n
i.p = j
i.t = c
k.u = j
k.t = g
k.v = a
n.v = m
n.p = h
n.o = a
b.v = j
b.u = n
b.w = i
b.q = i
b.p = c
a.v = m
a.p = h
a.o = n
assert j.u.p.p.o.p.p.txt == "a"