class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

l.v = g
c.u = l
c.z = b
c.v = g
m.q = d
m.x = d
m.y = d
m.z = i
m.u = g
b.y = i
b.o = m
b.t = j
b.u = e
e.x = i
e.z = l
e.p = d
j.u = l
j.z = b
j.v = c
g.u = l
g.z = b
g.v = c
i.y = b
i.o = m
i.t = c
i.u = e
d.x = i
d.z = l
d.p = e
assert i.y.t.u.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

l.v = g
c.u = l
c.z = b
c.v = g
m.q = d
m.x = d
m.y = d
m.z = i
m.u = g
b.y = i
b.o = m
b.t = j
b.u = e
e.x = i
e.z = l
e.p = d
j.u = l
j.z = b
j.v = c
g.u = l
g.z = b
g.v = c
i.y = b
i.o = m
i.t = c
i.u = e
d.x = i
d.z = l
d.p = e
assert i.y.t.u.v.v.txt == "c"