class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: D = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.u: C = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

e.v = h
e.w = h
e.t = i
e.q = m
i.o = h
i.p = h
i.u = m
i.y = c
m.p = c
h.p = e
c.y = a
a.y = c
g.o = h
g.p = h
g.u = m
g.y = a
d.o = h
d.p = h
d.u = m
d.y = a
j.v = h
j.w = h
j.t = d
j.q = m
assert d.y.y.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: D = None
        self.t: B = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: D = None
        self.u: C = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

e.v = h
e.w = h
e.t = i
e.q = m
i.o = h
i.p = h
i.u = m
i.y = c
m.p = c
h.p = e
c.y = a
a.y = c
g.o = h
g.p = h
g.u = m
g.y = a
d.o = h
d.p = h
d.u = m
d.y = a
j.v = h
j.w = h
j.t = d
j.q = m
assert d.y.y.y.y.y.y.y.y.txt == "c"