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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: F = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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