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

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

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

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

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

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

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

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

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

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

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

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

k.y = g
k.s = l
k.x = l
k.v = n
n.u = j
j.v = k
j.x = g
j.p = g
j.q = i
m.u = k
m.x = k
m.p = j
m.s = j
l.q = m
h.q = m
g.v = k
g.x = j
g.p = j
g.q = i
i.q = m
assert m.p.p.q.q.p.txt == "j"