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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.v: A = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: F = None
        self.z: C = None
        self.r: C = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: G = None
        self.v: A = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: F = None
        self.z: C = None
        self.r: C = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

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

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