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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
e = C("e")
a = D("a")
l = E("l")
f = F("f")
n = F("n")

h.u = f
h.r = i
i.v = h
i.q = e
i.o = l
e.w = a
a.s = e
a.o = f
l.x = h
l.o = e
f.y = a
n.y = a
assert l.x.r.v.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: F = None
        self.txt = txt

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

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

h = A("h")
i = B("i")
e = C("e")
a = D("a")
l = E("l")
f = F("f")
n = F("n")

h.u = f
h.r = i
i.v = h
i.q = e
i.o = l
e.w = a
a.s = e
a.o = f
l.x = h
l.o = e
f.y = a
n.y = a
assert l.x.r.v.u.y.txt == "a"