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

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

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

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

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

j = A("j")
l = B("l")
g = C("g")
m = D("m")
k = E("k")
h = C("h")

j.o = k
j.x = m
j.p = m
j.y = l
j.t = h
l.w = k
l.s = g
g.y = j
g.o = k
m.v = l
k.s = m
k.u = m
k.v = m
k.x = h
k.o = g
h.y = j
h.o = k
assert l.s.y.p.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: D = None
        self.y: B = None
        self.p: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

j = A("j")
l = B("l")
g = C("g")
m = D("m")
k = E("k")
h = C("h")

j.o = k
j.x = m
j.p = m
j.y = l
j.t = h
l.w = k
l.s = g
g.y = j
g.o = k
m.v = l
k.s = m
k.u = m
k.v = m
k.x = h
k.o = g
h.y = j
h.o = k
assert l.s.y.p.v.w.txt == "k"