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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.p: B = None
        self.r: D = None
        self.txt = txt

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

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

i.s = h
i.o = n
n.x = i
n.u = l
f.x = i
f.p = n
m.x = l
h.w = n
h.p = n
h.t = m
h.r = m
b.v = m
b.z = i
e.x = i
e.p = n
l.w = n
l.p = n
l.t = m
l.r = m
assert e.p.x.s.w.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: D = None
        self.p: B = None
        self.r: D = None
        self.txt = txt

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

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

i.s = h
i.o = n
n.x = i
n.u = l
f.x = i
f.p = n
m.x = l
h.w = n
h.p = n
h.t = m
h.r = m
b.v = m
b.z = i
e.x = i
e.p = n
l.w = n
l.p = n
l.t = m
l.r = m
assert e.p.x.s.w.x.s.txt == "h"