class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.u: D = None
        self.p: E = None
        self.x: C = 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.u: A = None
        self.r: E = None
        self.y: E = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

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

j.s = n
j.u = n
j.v = k
j.p = h
j.x = l
k.u = l
l.u = j
l.r = h
l.y = h
l.q = h
l.p = h
n.p = j
n.v = j
n.u = l
n.r = l
n.x = k
h.y = j
h.t = j
h.q = j
h.u = k
h.x = l
assert l.u.x.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: B = None
        self.u: D = None
        self.p: E = None
        self.x: C = 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.u: A = None
        self.r: E = None
        self.y: E = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

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

j.s = n
j.u = n
j.v = k
j.p = h
j.x = l
k.u = l
l.u = j
l.r = h
l.y = h
l.q = h
l.p = h
n.p = j
n.v = j
n.u = l
n.r = l
n.x = k
h.y = j
h.t = j
h.q = j
h.u = k
h.x = l
assert l.u.x.u.v.u.txt == "l"