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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: B = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.r: E = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.txt = txt

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

j.w = k
j.y = e
e.z = k
e.s = m
e.x = j
e.r = n
k.z = j
k.s = j
k.u = e
k.x = m
i.w = j
i.y = n
i.r = m
i.s = h
m.o = i
n.t = j
n.q = i
h.t = j
h.q = l
l.w = j
l.y = h
l.r = m
l.s = n
assert e.r.t.w.z.w.x.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: B = None
        self.s: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.r: E = None
        self.s: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.txt = txt

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

j.w = k
j.y = e
e.z = k
e.s = m
e.x = j
e.r = n
k.z = j
k.s = j
k.u = e
k.x = m
i.w = j
i.y = n
i.r = m
i.s = h
m.o = i
n.t = j
n.q = i
h.t = j
h.q = l
l.w = j
l.y = h
l.r = m
l.s = n
assert e.r.t.w.z.w.x.o.r.txt == "m"