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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: G = None
        self.txt = txt

a = A("a")
e = B("e")
h = C("h")
m = D("m")
l = E("l")
i = F("i")
b = G("b")
k = D("k")
j = G("j")
g = G("g")

a.x = e
a.y = l
a.t = l
a.o = i
a.w = b
a.p = h
e.x = k
h.q = m
h.z = k
h.o = k
m.q = l
m.o = a
m.p = k
m.x = k
m.r = b
m.z = j
l.u = b
l.x = h
i.u = b
i.t = e
b.v = e
b.y = j
k.q = l
k.o = a
k.p = m
k.x = m
k.r = j
k.z = g
j.v = e
j.y = b
g.v = e
g.y = b
assert j.v.x.p.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.o: F = None
        self.w: G = None
        self.t: E = None
        self.p: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: G = None
        self.txt = txt

a = A("a")
e = B("e")
h = C("h")
m = D("m")
l = E("l")
i = F("i")
b = G("b")
k = D("k")
j = G("j")
g = G("g")

a.x = e
a.y = l
a.t = l
a.o = i
a.w = b
a.p = h
e.x = k
h.q = m
h.z = k
h.o = k
m.q = l
m.o = a
m.p = k
m.x = k
m.r = b
m.z = j
l.u = b
l.x = h
i.u = b
i.t = e
b.v = e
b.y = j
k.q = l
k.o = a
k.p = m
k.x = m
k.r = j
k.z = g
j.v = e
j.y = b
g.v = e
g.y = b
assert j.v.x.p.z.v.txt == "e"