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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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