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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.w: B = None
        self.s: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.w: B = None
        self.s: B = None
        self.v: E = None
        self.txt = txt

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

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

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

h.o = g
h.z = g
h.p = l
h.x = l
h.s = m
f.s = i
d.p = i
d.q = l
d.w = g
d.s = f
d.v = b
m.q = d
m.r = e
b.y = d
b.x = e
g.s = i
l.y = d
l.x = e
e.o = f
e.z = g
e.p = b
e.x = b
e.s = m
i.p = d
i.q = l
i.w = g
i.s = f
i.v = b
assert f.s.v.x.s.txt == "m"