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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.t: C = None
        self.v: F = None
        self.p: A = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.t: C = None
        self.v: F = None
        self.p: A = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

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

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