class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.t: B = None
        self.p: B = None
        self.y: C = None
        self.x: B = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: D = None
        self.q: G = None
        self.x: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: E = None
        self.y: B = None
        self.w: D = None
        self.txt = txt

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

a = A("a")
e = B("e")
l = C("l")
i = D("i")
k = E("k")
h = F("h")
n = G("n")
b = A("b")
d = C("d")
c = B("c")

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: D = None
        self.q: G = None
        self.x: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: E = None
        self.y: B = None
        self.w: D = None
        self.txt = txt

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

a = A("a")
e = B("e")
l = C("l")
i = D("i")
k = E("k")
h = F("h")
n = G("n")
b = A("b")
d = C("d")
c = B("c")

a.u = i
a.w = c
a.p = c
a.x = c
a.t = e
a.y = l
a.z = b
e.u = n
e.q = n
e.x = n
e.r = i
l.t = c
i.x = n
k.r = n
h.u = n
h.o = k
h.y = c
h.w = i
n.y = h
n.x = i
n.s = i
n.p = l
n.r = a
n.u = d
b.u = i
b.w = e
b.p = e
b.x = e
b.t = c
b.y = l
b.z = a
d.t = c
c.u = n
c.q = n
c.x = n
c.r = i
assert d.t.x.x.x.txt == "n"