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

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

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

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

l = A("l")
i = B("i")
e = C("e")
g = D("g")
k = A("k")
f = C("f")
j = C("j")
b = C("b")

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

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

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

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

l = A("l")
i = B("i")
e = C("e")
g = D("g")
k = A("k")
f = C("f")
j = C("j")
b = C("b")

l.u = e
l.s = i
l.z = i
l.w = k
i.p = k
e.r = g
e.t = i
e.x = l
g.x = f
g.u = e
k.u = b
k.s = i
k.z = i
k.w = l
f.r = g
f.t = i
f.x = k
j.r = g
j.t = i
j.x = l
b.r = g
b.t = i
b.x = k
assert i.p.u.t.p.txt == "k"