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

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

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

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

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

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

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

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

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

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

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