class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.s: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: B = None
        self.s: F = None
        self.r: C = None
        self.txt = txt

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

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