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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.u: C = 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.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.u: C = 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.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.txt = txt

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

m.s = j
j.z = k
j.u = i
j.p = l
n.x = m
n.v = i
n.u = h
l.v = j
k.u = l
i.r = j
i.u = l
h.x = m
h.v = i
h.u = n
assert l.v.u.r.p.txt == "l"