class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: F = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.t: A = None
        self.o: D = None
        self.r: B = None
        self.s: F = None
        self.txt = txt

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

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

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

a = A("a")
d = B("d")
n = C("n")
e = D("e")
m = E("m")
i = F("i")
b = E("b")
l = D("l")
h = F("h")
j = E("j")

a.r = j
a.z = h
a.y = h
a.u = d
d.v = m
d.z = n
d.q = e
d.x = a
n.z = d
n.w = d
n.r = d
n.t = a
n.o = l
n.s = h
e.y = l
e.t = j
m.z = i
m.r = e
i.v = j
i.p = e
b.z = i
b.r = l
l.y = e
l.t = m
h.v = b
h.p = l
j.z = h
j.r = l
assert h.p.t.z.v.r.y.t.z.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: F = None
        self.y: F = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.t: A = None
        self.o: D = None
        self.r: B = None
        self.s: F = None
        self.txt = txt

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

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

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

a = A("a")
d = B("d")
n = C("n")
e = D("e")
m = E("m")
i = F("i")
b = E("b")
l = D("l")
h = F("h")
j = E("j")

a.r = j
a.z = h
a.y = h
a.u = d
d.v = m
d.z = n
d.q = e
d.x = a
n.z = d
n.w = d
n.r = d
n.t = a
n.o = l
n.s = h
e.y = l
e.t = j
m.z = i
m.r = e
i.v = j
i.p = e
b.z = i
b.r = l
l.y = e
l.t = m
h.v = b
h.p = l
j.z = h
j.r = l
assert h.p.t.z.v.r.y.t.z.v.r.txt == "l"