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

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

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

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

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

f = A("f")
h = B("h")
j = C("j")
b = D("b")
k = E("k")
i = B("i")
l = A("l")

f.s = k
f.q = j
h.s = f
h.w = i
h.t = l
j.x = k
j.o = k
b.o = j
b.v = j
b.x = k
b.p = k
b.r = k
k.x = j
k.t = i
k.o = i
k.w = b
i.s = l
i.t = l
i.w = h
l.s = k
l.q = j
assert j.o.x.x.w.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
j = C("j")
b = D("b")
k = E("k")
i = B("i")
l = A("l")

f.s = k
f.q = j
h.s = f
h.w = i
h.t = l
j.x = k
j.o = k
b.o = j
b.v = j
b.x = k
b.p = k
b.r = k
k.x = j
k.t = i
k.o = i
k.w = b
i.s = l
i.t = l
i.w = h
l.s = k
l.q = j
assert j.o.x.x.w.o.o.txt == "k"