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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

i = A("i")
k = B("k")
m = C("m")
a = D("a")
j = E("j")
b = F("b")
f = G("f")
e = E("e")

i.y = j
i.o = m
i.z = f
k.p = f
k.r = f
k.z = b
m.t = j
a.s = b
j.v = a
j.p = a
j.u = k
j.w = k
j.s = i
j.q = b
j.z = e
b.p = a
f.q = m
f.z = j
e.v = a
e.p = a
e.u = k
e.w = k
e.s = i
e.q = b
e.z = j
assert a.s.p.s.p.s.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: C = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

i = A("i")
k = B("k")
m = C("m")
a = D("a")
j = E("j")
b = F("b")
f = G("f")
e = E("e")

i.y = j
i.o = m
i.z = f
k.p = f
k.r = f
k.z = b
m.t = j
a.s = b
j.v = a
j.p = a
j.u = k
j.w = k
j.s = i
j.q = b
j.z = e
b.p = a
f.q = m
f.z = j
e.v = a
e.p = a
e.u = k
e.w = k
e.s = i
e.q = b
e.z = j
assert a.s.p.s.p.s.p.s.txt == "b"