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

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

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

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

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

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

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

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

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

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

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

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

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