class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.y: E = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

a = A("a")
k = B("k")
l = C("l")
i = D("i")
g = E("g")
h = F("h")
f = B("f")
m = E("m")

a.q = g
a.u = h
a.y = m
a.t = i
a.z = l
k.s = f
l.y = i
l.v = a
l.o = a
i.t = a
i.w = a
i.q = f
i.y = h
i.u = l
g.u = a
h.p = f
h.v = l
h.z = i
h.u = m
f.s = k
m.u = a
assert m.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: F = None
        self.y: E = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

a = A("a")
k = B("k")
l = C("l")
i = D("i")
g = E("g")
h = F("h")
f = B("f")
m = E("m")

a.q = g
a.u = h
a.y = m
a.t = i
a.z = l
k.s = f
l.y = i
l.v = a
l.o = a
i.t = a
i.w = a
i.q = f
i.y = h
i.u = l
g.u = a
h.p = f
h.v = l
h.z = i
h.u = m
f.s = k
m.u = a
assert m.u.u.u.u.txt == "a"