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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

l = A("l")
j = B("j")
g = C("g")
m = D("m")
e = E("e")
i = B("i")
f = E("f")
n = C("n")
d = C("d")

l.r = m
l.s = j
l.t = j
l.x = e
l.v = d
j.s = e
j.w = g
j.p = l
g.s = j
m.p = l
m.x = j
e.t = j
i.s = e
i.w = n
i.p = l
f.t = j
n.s = i
d.s = j
assert j.p.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: B = None
        self.x: E = None
        self.t: B = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

l = A("l")
j = B("j")
g = C("g")
m = D("m")
e = E("e")
i = B("i")
f = E("f")
n = C("n")
d = C("d")

l.r = m
l.s = j
l.t = j
l.x = e
l.v = d
j.s = e
j.w = g
j.p = l
g.s = j
m.p = l
m.x = j
e.t = j
i.s = e
i.w = n
i.p = l
f.t = j
n.s = i
d.s = j
assert j.p.x.t.txt == "j"