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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.v: C = None
        self.txt = txt

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

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

l = A("l")
m = B("m")
b = C("b")
d = D("d")
i = E("i")
g = F("g")
e = G("e")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: A = None
        self.v: C = None
        self.txt = txt

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

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

l = A("l")
m = B("m")
b = C("b")
d = D("d")
i = E("i")
g = F("g")
e = G("e")

l.x = e
l.q = i
l.s = b
l.t = b
l.y = g
l.r = g
m.u = b
b.q = l
b.x = e
d.t = g
d.w = m
d.r = l
d.s = i
d.o = e
i.p = g
i.q = l
i.v = b
g.q = d
g.x = d
g.z = i
e.p = b
e.v = g
e.s = g
e.y = g
e.x = i
e.u = m
e.t = d
assert e.u.u.x.u.txt == "m"