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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: G = None
        self.x: F = None
        self.r: B = None
        self.q: D = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: G = None
        self.x: F = None
        self.r: B = None
        self.q: D = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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