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

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

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

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

f = A("f")
g = B("g")
k = C("k")
e = D("e")
a = B("a")
n = C("n")
c = B("c")
i = D("i")
l = A("l")
b = B("b")

f.t = e
f.s = e
f.u = b
f.w = l
g.q = l
g.u = c
k.q = c
k.u = e
k.t = n
e.p = k
e.x = i
e.u = i
e.z = l
a.q = f
a.u = c
n.q = g
n.u = i
n.t = k
c.q = f
c.u = a
i.p = k
i.x = e
i.u = e
i.z = f
l.t = i
l.u = b
l.s = e
l.w = f
b.q = f
b.u = g
assert b.q.t.z.w.u.q.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.s: D = None
        self.w: A = None
        self.txt = txt

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

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

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

f = A("f")
g = B("g")
k = C("k")
e = D("e")
a = B("a")
n = C("n")
c = B("c")
i = D("i")
l = A("l")
b = B("b")

f.t = e
f.s = e
f.u = b
f.w = l
g.q = l
g.u = c
k.q = c
k.u = e
k.t = n
e.p = k
e.x = i
e.u = i
e.z = l
a.q = f
a.u = c
n.q = g
n.u = i
n.t = k
c.q = f
c.u = a
i.p = k
i.x = e
i.u = e
i.z = f
l.t = i
l.u = b
l.s = e
l.w = f
b.q = f
b.u = g
assert b.q.t.z.w.u.q.u.u.txt == "g"