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

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

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

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

n = A("n")
m = B("m")
k = C("k")
g = D("g")
b = B("b")
i = B("i")
a = A("a")
j = B("j")
d = B("d")
f = D("f")

n.y = k
n.o = k
n.t = j
n.x = a
m.q = k
m.z = k
m.w = k
m.u = a
k.q = f
g.s = k
g.z = f
b.q = k
b.z = k
b.w = k
b.u = n
i.q = k
i.z = k
i.w = k
i.u = n
a.y = k
a.o = k
a.t = j
a.x = n
j.q = k
j.z = k
j.w = k
j.u = n
d.q = k
d.z = k
d.w = k
d.u = a
f.s = k
f.z = g
assert d.u.t.z.q.z.s.q.s.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: B = None
        self.x: A = None
        self.o: C = None
        self.txt = txt

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

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

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

n = A("n")
m = B("m")
k = C("k")
g = D("g")
b = B("b")
i = B("i")
a = A("a")
j = B("j")
d = B("d")
f = D("f")

n.y = k
n.o = k
n.t = j
n.x = a
m.q = k
m.z = k
m.w = k
m.u = a
k.q = f
g.s = k
g.z = f
b.q = k
b.z = k
b.w = k
b.u = n
i.q = k
i.z = k
i.w = k
i.u = n
a.y = k
a.o = k
a.t = j
a.x = n
j.q = k
j.z = k
j.w = k
j.u = n
d.q = k
d.z = k
d.w = k
d.u = a
f.s = k
f.z = g
assert d.u.t.z.q.z.s.q.s.q.z.txt == "g"