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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: C = None
        self.r: C = None
        self.y: A = None
        self.v: F = None
        self.q: A = None
        self.z: G = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
h = C("h")
a = D("a")
d = E("d")
m = F("m")
i = G("i")

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

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

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: C = None
        self.r: C = None
        self.y: A = None
        self.v: F = None
        self.q: A = None
        self.z: G = None
        self.txt = txt

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

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

k = A("k")
g = B("g")
h = C("h")
a = D("a")
d = E("d")
m = F("m")
i = G("i")

k.w = d
k.o = i
k.r = h
g.z = i
g.p = h
g.v = k
h.z = i
a.q = k
a.x = d
d.p = k
d.y = k
d.q = k
d.x = h
d.r = h
d.v = m
d.z = i
m.u = g
i.t = a
i.s = k
assert i.s.o.s.r.z.s.txt == "k"