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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: F = None
        self.r: B = None
        self.z: F = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

g = A("g")
n = B("n")
j = C("j")
e = D("e")
f = E("f")
k = F("k")
d = G("d")

g.x = n
n.z = d
n.t = d
n.o = j
n.p = e
n.r = g
n.x = f
j.x = n
j.r = n
j.s = k
j.z = k
j.v = e
j.u = e
e.p = k
e.q = d
e.x = g
f.z = j
k.x = n
k.v = n
k.r = n
k.q = g
k.s = f
k.t = d
d.w = f
assert g.x.x.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: F = None
        self.r: B = None
        self.z: F = None
        self.v: D = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

g = A("g")
n = B("n")
j = C("j")
e = D("e")
f = E("f")
k = F("k")
d = G("d")

g.x = n
n.z = d
n.t = d
n.o = j
n.p = e
n.r = g
n.x = f
j.x = n
j.r = n
j.s = k
j.z = k
j.v = e
j.u = e
e.p = k
e.q = d
e.x = g
f.z = j
k.x = n
k.v = n
k.r = n
k.q = g
k.s = f
k.t = d
d.w = f
assert g.x.x.z.z.txt == "k"