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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.o: A = None
        self.q: F = None
        self.p: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: B = None
        self.o: A = None
        self.q: F = None
        self.p: C = None
        self.u: A = None
        self.txt = txt

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

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

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

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