class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: F = None
        self.p: F = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: D = None
        self.r: D = None
        self.v: B = None
        self.txt = txt

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

l.t = a
l.r = f
l.p = f
l.q = i
l.y = h
h.u = i
h.z = i
h.v = f
h.o = g
i.q = g
g.u = h
g.t = l
g.x = a
a.q = h
f.o = i
f.z = g
f.r = g
f.v = h
assert a.q.z.q.t.y.u.txt == "i"