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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.z: F = None
        self.o: A = None
        self.w: G = None
        self.t: G = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: C = None
        self.o: F = None
        self.v: F = None
        self.q: B = None
        self.r: B = None
        self.z: A = None
        self.txt = txt

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

g = A("g")
l = B("l")
j = C("j")
m = D("m")
c = E("c")
d = F("d")
b = G("b")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: D = None
        self.z: F = None
        self.o: A = None
        self.w: G = None
        self.t: G = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: C = None
        self.o: F = None
        self.v: F = None
        self.q: B = None
        self.r: B = None
        self.z: A = None
        self.txt = txt

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

g = A("g")
l = B("l")
j = C("j")
m = D("m")
c = E("c")
d = F("d")
b = G("b")
f = F("f")

g.t = b
g.z = d
l.q = j
l.p = m
l.z = f
l.o = g
l.w = b
l.t = b
l.s = c
j.s = l
j.r = g
m.y = j
c.u = d
d.y = f
d.o = f
d.v = f
d.w = j
d.q = l
d.r = l
d.z = g
b.z = g
b.p = f
f.y = d
f.o = d
f.v = d
f.w = j
f.q = l
f.r = l
f.z = g
assert d.q.q.s.txt == "l"