class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: F = None
        self.y: C = None
        self.o: A = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: F = None
        self.y: C = None
        self.o: A = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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