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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

e = A("e")
m = B("m")
c = C("c")
a = D("a")
f = E("f")
j = F("j")
l = E("l")
i = E("i")

e.v = a
m.r = f
m.v = l
c.p = e
c.r = a
c.u = m
a.y = j
a.p = j
a.r = e
a.x = m
f.x = m
f.t = j
f.s = i
f.p = l
j.r = e
l.x = m
l.t = j
l.s = f
l.p = i
i.x = m
i.t = j
i.s = f
i.p = l
assert j.r.v.x.r.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

e = A("e")
m = B("m")
c = C("c")
a = D("a")
f = E("f")
j = F("j")
l = E("l")
i = E("i")

e.v = a
m.r = f
m.v = l
c.p = e
c.r = a
c.u = m
a.y = j
a.p = j
a.r = e
a.x = m
f.x = m
f.t = j
f.s = i
f.p = l
j.r = e
l.x = m
l.t = j
l.s = f
l.p = i
i.x = m
i.t = j
i.s = f
i.p = l
assert j.r.v.x.r.x.v.txt == "l"