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

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.v: E = None
        self.w: A = None
        self.txt = txt

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

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

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

k = A("k")
h = B("h")
c = C("c")
a = D("a")
j = E("j")
f = E("f")
i = C("i")
e = D("e")
d = B("d")
b = A("b")

k.x = a
h.s = d
h.u = e
h.v = f
h.w = k
c.o = h
a.w = j
a.q = j
a.p = j
a.x = e
a.v = f
j.u = b
f.u = k
i.o = d
e.w = f
e.v = f
e.x = a
e.q = j
e.p = j
d.s = h
d.u = e
d.v = f
d.w = b
b.x = e
assert k.x.v.u.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.v: E = None
        self.w: A = None
        self.txt = txt

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

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

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

k = A("k")
h = B("h")
c = C("c")
a = D("a")
j = E("j")
f = E("f")
i = C("i")
e = D("e")
d = B("d")
b = A("b")

k.x = a
h.s = d
h.u = e
h.v = f
h.w = k
c.o = h
a.w = j
a.q = j
a.p = j
a.x = e
a.v = f
j.u = b
f.u = k
i.o = d
e.w = f
e.v = f
e.x = a
e.q = j
e.p = j
d.s = h
d.u = e
d.v = f
d.w = b
b.x = e
assert k.x.v.u.x.q.txt == "j"