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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.q: B = None
        self.w: F = 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.s: C = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.q: B = None
        self.w: F = 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.s: C = None
        self.q: E = None
        self.txt = txt

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

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