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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: B = None
        self.y: A = None
        self.s: C = None
        self.x: E = None
        self.r: B = None
        self.u: F = None
        self.txt = txt

i = A("i")
k = B("k")
g = C("g")
b = D("b")
h = E("h")
l = F("l")
e = G("e")
a = G("a")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: B = None
        self.y: A = None
        self.s: C = None
        self.x: E = None
        self.r: B = None
        self.u: F = None
        self.txt = txt

i = A("i")
k = B("k")
g = C("g")
b = D("b")
h = E("h")
l = F("l")
e = G("e")
a = G("a")

i.x = a
k.v = i
k.q = i
k.u = b
k.z = a
g.p = i
g.x = i
g.r = b
g.z = a
g.s = k
b.x = k
b.t = g
h.x = b
l.y = a
l.x = b
l.w = g
e.t = a
e.z = k
e.r = k
e.y = i
e.s = g
e.x = h
e.u = l
a.t = e
a.z = k
a.r = k
a.y = i
a.s = g
a.x = h
a.u = l
assert b.t.x.x.txt == "a"