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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: D = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

b = A("b")
l = B("l")
j = C("j")
g = D("g")
e = A("e")
a = A("a")
n = D("n")
i = C("i")

b.u = l
b.x = i
b.v = i
l.w = g
l.y = g
l.z = i
l.v = j
j.s = i
j.u = g
j.v = n
j.z = e
g.x = e
g.p = i
g.v = b
g.t = b
e.u = l
e.x = i
e.v = j
a.u = l
a.x = j
a.v = j
n.x = b
n.p = j
n.v = a
n.t = e
i.s = j
i.u = g
i.v = g
i.z = a
assert a.v.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: D = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

b = A("b")
l = B("l")
j = C("j")
g = D("g")
e = A("e")
a = A("a")
n = D("n")
i = C("i")

b.u = l
b.x = i
b.v = i
l.w = g
l.y = g
l.z = i
l.v = j
j.s = i
j.u = g
j.v = n
j.z = e
g.x = e
g.p = i
g.v = b
g.t = b
e.u = l
e.x = i
e.v = j
a.u = l
a.x = j
a.v = j
n.x = b
n.p = j
n.v = a
n.t = e
i.s = j
i.u = g
i.v = g
i.z = a
assert a.v.z.u.txt == "l"