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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: E = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: F = None
        self.o: F = None
        self.w: F = None
        self.q: D = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: G = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: E = None
        self.z: G = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: F = None
        self.o: F = None
        self.w: F = None
        self.q: D = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

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