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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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