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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.x: B = None
        self.txt = txt

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

g.u = i
l.z = n
l.r = k
l.x = k
l.u = d
c.q = g
c.t = g
c.w = i
c.v = l
i.t = k
k.z = n
k.x = n
k.r = c
n.z = d
n.u = d
n.r = k
n.x = k
a.t = k
d.z = n
d.u = n
d.r = k
d.x = k
assert l.u.u.x.x.r.x.txt == "n"