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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: B = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: B = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

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

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

g.t = i
g.z = i
g.u = a
g.v = n
j.y = k
j.u = n
a.r = c
a.u = n
a.x = j
a.s = j
c.u = g
c.v = i
c.r = l
i.t = g
i.z = g
i.u = a
i.v = j
d.r = l
d.u = n
d.x = n
d.s = n
k.t = g
k.z = g
k.u = a
k.v = j
l.u = k
l.v = k
l.r = c
n.y = g
n.u = j
assert k.z.t.u.x.txt == "j"