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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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