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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.y: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.x: G = None
        self.s: B = None
        self.u: G = None
        self.y: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.y: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: E = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.x: G = None
        self.s: B = None
        self.u: G = None
        self.y: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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