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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: D = None
        self.q: F = None
        self.y: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: G = None
        self.v: B = None
        self.r: C = None
        self.z: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: D = None
        self.q: F = None
        self.y: F = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: G = None
        self.v: B = None
        self.r: C = None
        self.z: A = None
        self.txt = txt

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

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

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