class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.z: D = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: B = None
        self.p: A = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.u: A = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

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

k = A("k")
l = B("l")
d = C("d")
e = D("e")
b = E("b")
h = A("h")
a = B("a")
g = B("g")

k.o = b
k.v = b
k.u = d
k.z = e
l.s = e
d.v = h
d.p = h
d.z = h
d.s = g
d.u = e
e.s = d
e.o = k
e.w = k
e.u = h
e.q = g
b.x = h
b.u = d
b.o = k
b.z = e
h.o = b
h.v = b
h.u = d
h.z = e
a.s = e
g.s = e
assert d.v.u.s.s.s.v.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.z: D = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: B = None
        self.p: A = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: A = None
        self.u: A = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

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

k = A("k")
l = B("l")
d = C("d")
e = D("e")
b = E("b")
h = A("h")
a = B("a")
g = B("g")

k.o = b
k.v = b
k.u = d
k.z = e
l.s = e
d.v = h
d.p = h
d.z = h
d.s = g
d.u = e
e.s = d
e.o = k
e.w = k
e.u = h
e.q = g
b.x = h
b.u = d
b.o = k
b.z = e
h.o = b
h.v = b
h.u = d
h.z = e
a.s = e
g.s = e
assert d.v.u.s.s.s.v.u.s.txt == "g"