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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: C = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

e = A("e")
n = B("n")
a = C("a")
d = D("d")
i = E("i")
b = F("b")
k = D("k")
l = C("l")
f = A("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: C = None
        self.p: B = None
        self.s: B = None
        self.txt = txt

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

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

e = A("e")
n = B("n")
a = C("a")
d = D("d")
i = E("i")
b = F("b")
k = D("k")
l = C("l")
f = A("f")

e.w = n
e.u = a
e.r = f
n.r = f
n.o = b
n.q = k
a.s = i
a.q = i
d.y = n
d.p = n
d.s = n
d.z = l
i.z = l
i.o = n
i.w = n
i.s = b
b.t = d
b.x = e
b.q = e
b.y = i
b.o = i
b.w = n
k.y = n
k.p = n
k.s = n
k.z = a
l.s = i
l.q = i
f.w = n
f.u = a
f.r = e
assert n.o.x.u.s.txt == "i"