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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: E = None
        self.x: D = None
        self.v: A = None
        self.o: B = None
        self.t: E = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.txt = txt

g = A("g")
l = B("l")
k = C("k")
i = D("i")
a = E("a")
n = F("n")
m = G("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: F = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: E = None
        self.x: D = None
        self.v: A = None
        self.o: B = None
        self.t: E = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: E = None
        self.txt = txt

g = A("g")
l = B("l")
k = C("k")
i = D("i")
a = E("a")
n = F("n")
m = G("m")

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