class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: A = None
        self.v: E = None
        self.x: D = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: E = None
        self.txt = txt

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

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

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

a.s = f
a.u = i
a.v = l
a.x = c
a.z = k
b.o = k
b.p = k
b.w = e
k.q = c
k.t = b
c.u = k
c.r = l
l.r = f
l.q = b
l.v = m
e.s = i
m.s = a
f.u = k
f.r = l
i.s = f
i.x = f
i.u = a
i.v = l
i.z = k
assert l.q.w.s.z.q.u.t.txt == "b"