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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.t: F = None
        self.q: C = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: F = None
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: E = None
        self.q: H = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: B = None
        self.z: G = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.t: F = None
        self.q: C = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: F = None
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: E = None
        self.q: H = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: B = None
        self.z: G = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

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

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