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

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

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

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

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

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

n = A("n")
i = B("i")
e = C("e")
m = D("m")
k = E("k")
h = F("h")

n.o = k
n.u = m
n.y = h
n.r = h
i.v = m
i.y = n
i.r = n
e.r = n
m.v = i
k.s = n
h.v = m
h.y = e
h.p = k
h.t = k
h.r = i
assert h.p.s.r.p.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: D = None
        self.y: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

n = A("n")
i = B("i")
e = C("e")
m = D("m")
k = E("k")
h = F("h")

n.o = k
n.u = m
n.y = h
n.r = h
i.v = m
i.y = n
i.r = n
e.r = n
m.v = i
k.s = n
h.v = m
h.y = e
h.p = k
h.t = k
h.r = i
assert h.p.s.r.p.s.u.txt == "m"