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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.q: D = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: D = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

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

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