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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: E = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.p: A = None
        self.q: F = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: E = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: A = None
        self.p: A = None
        self.q: F = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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