class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: D = None
        self.o: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.t: C = None
        self.s: B = None
        self.o: G = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: G = None
        self.t: C = None
        self.s: B = None
        self.o: G = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: E = None
        self.txt = txt

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

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