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

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

class C:
    def __init__(self, txt: str):
        self.w: F = 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.q: D = None
        self.w: D = None
        self.txt = txt

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

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

e.o = d
e.y = i
n.s = k
n.r = k
n.v = i
h.w = k
i.v = n
a.q = i
a.w = i
k.y = i
k.u = i
k.r = d
d.o = e
d.y = i
assert h.w.r.o.y.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = 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.q: D = None
        self.w: D = None
        self.txt = txt

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

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

e.o = d
e.y = i
n.s = k
n.r = k
n.v = i
h.w = k
i.v = n
a.q = i
a.w = i
k.y = i
k.u = i
k.r = d
d.o = e
d.y = i
assert h.w.r.o.y.v.s.txt == "k"