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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.v: F = None
        self.txt = txt

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

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

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

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