class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: D = None
        self.p: E = None
        self.q: D = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.v: C = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.v: C = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

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

i.z = a
i.y = c
i.q = c
i.p = h
i.v = h
k.y = b
k.t = b
k.o = d
k.q = h
l.r = g
c.r = h
c.y = i
c.v = g
c.w = a
c.u = a
h.v = c
h.x = a
h.t = i
h.w = l
b.z = a
b.y = a
b.p = h
b.v = h
b.q = c
g.r = l
d.y = i
d.t = i
d.o = k
d.q = h
a.r = h
a.y = i
a.v = g
a.w = c
a.u = c
assert b.v.v.v.r.r.r.r.txt == "g"