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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: B = None
        self.y: D = None
        self.r: E = None
        self.o: D = None
        self.txt = txt

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

g.v = h
g.t = d
g.o = d
g.s = c
g.y = b
i.q = g
i.z = c
c.s = e
c.q = e
c.w = g
e.r = i
e.t = g
e.y = g
e.x = h
n.z = e
n.y = e
n.o = e
n.w = i
n.r = d
d.z = e
d.y = e
d.o = e
d.w = b
d.r = n
b.q = g
b.z = c
h.q = g
h.z = l
l.s = e
l.q = e
l.w = g
assert d.r.y.x.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: E = None
        self.s: C = None
        self.o: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: B = None
        self.y: D = None
        self.r: E = None
        self.o: D = None
        self.txt = txt

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

g.v = h
g.t = d
g.o = d
g.s = c
g.y = b
i.q = g
i.z = c
c.s = e
c.q = e
c.w = g
e.r = i
e.t = g
e.y = g
e.x = h
n.z = e
n.y = e
n.o = e
n.w = i
n.r = d
d.z = e
d.y = e
d.o = e
d.w = b
d.r = n
b.q = g
b.z = c
h.q = g
h.z = l
l.s = e
l.q = e
l.w = g
assert d.r.y.x.q.v.txt == "h"