class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.t: B = None
        self.p: B = None
        self.u: F = None
        self.r: C = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: F = None
        self.r: C = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: G = None
        self.p: B = None
        self.t: E = None
        self.u: D = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

g = A("g")
d = B("d")
l = C("l")
a = D("a")
f = E("f")
n = F("n")
b = G("b")
m = E("m")

g.z = n
g.u = n
g.x = d
g.t = d
g.p = d
g.r = l
g.q = b
d.r = a
l.o = f
a.w = l
a.t = l
f.z = b
f.p = n
f.o = n
f.r = l
f.q = m
n.o = b
n.w = b
n.p = d
n.q = d
n.t = f
n.u = a
n.s = a
b.o = n
m.z = b
m.p = n
m.o = n
m.r = l
m.q = f
assert f.o.t.q.q.z.o.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: B = None
        self.t: B = None
        self.p: B = None
        self.u: F = None
        self.r: C = None
        self.q: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: F = None
        self.r: C = None
        self.q: E = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: G = None
        self.p: B = None
        self.t: E = None
        self.u: D = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

g = A("g")
d = B("d")
l = C("l")
a = D("a")
f = E("f")
n = F("n")
b = G("b")
m = E("m")

g.z = n
g.u = n
g.x = d
g.t = d
g.p = d
g.r = l
g.q = b
d.r = a
l.o = f
a.w = l
a.t = l
f.z = b
f.p = n
f.o = n
f.r = l
f.q = m
n.o = b
n.w = b
n.p = d
n.q = d
n.t = f
n.u = a
n.s = a
b.o = n
m.z = b
m.p = n
m.o = n
m.r = l
m.q = f
assert f.o.t.q.q.z.o.w.o.txt == "n"