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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.t: G = None
        self.z: D = None
        self.s: A = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.z: G = None
        self.w: A = None
        self.t: C = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
m = C("m")
k = D("k")
f = E("f")
j = F("j")
e = G("e")

i.x = e
i.y = m
i.s = n
i.r = f
n.p = i
n.o = k
n.z = j
m.w = e
m.t = e
m.r = n
m.z = k
m.s = i
m.u = f
m.p = f
k.o = m
k.u = j
k.w = j
k.t = f
f.r = k
f.q = k
f.s = e
f.z = e
f.w = i
f.t = m
f.x = j
j.t = e
j.r = n
e.r = j
e.y = j
assert f.x.t.y.r.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: C = None
        self.s: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: B = None
        self.t: G = None
        self.z: D = None
        self.s: A = None
        self.u: E = None
        self.p: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: G = None
        self.z: G = None
        self.w: A = None
        self.t: C = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
m = C("m")
k = D("k")
f = E("f")
j = F("j")
e = G("e")

i.x = e
i.y = m
i.s = n
i.r = f
n.p = i
n.o = k
n.z = j
m.w = e
m.t = e
m.r = n
m.z = k
m.s = i
m.u = f
m.p = f
k.o = m
k.u = j
k.w = j
k.t = f
f.r = k
f.q = k
f.s = e
f.z = e
f.w = i
f.t = m
f.x = j
j.t = e
j.r = n
e.r = j
e.y = j
assert f.x.t.y.r.z.r.txt == "n"