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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: E = None
        self.s: F = None
        self.y: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: E = None
        self.s: B = None
        self.txt = txt

g = A("g")
b = B("b")
i = C("i")
c = D("c")
d = E("d")
e = F("e")
n = G("n")
j = B("j")

g.z = c
g.p = c
g.t = n
g.u = n
g.q = j
b.x = i
i.q = c
i.t = d
i.s = e
i.y = j
i.w = g
c.q = g
c.t = g
c.s = i
c.y = i
d.o = g
d.r = g
d.t = g
d.w = e
d.s = n
e.o = d
e.x = j
n.t = d
n.z = d
n.s = j
j.x = i
assert b.x.s.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: G = None
        self.p: D = None
        self.q: B = None
        self.u: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: E = None
        self.s: F = None
        self.y: B = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.y: C = None
        self.t: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: E = None
        self.s: B = None
        self.txt = txt

g = A("g")
b = B("b")
i = C("i")
c = D("c")
d = E("d")
e = F("e")
n = G("n")
j = B("j")

g.z = c
g.p = c
g.t = n
g.u = n
g.q = j
b.x = i
i.q = c
i.t = d
i.s = e
i.y = j
i.w = g
c.q = g
c.t = g
c.s = i
c.y = i
d.o = g
d.r = g
d.t = g
d.w = e
d.s = n
e.o = d
e.x = j
n.t = d
n.z = d
n.s = j
j.x = i
assert b.x.s.x.x.txt == "i"