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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.u: B = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.u: B = None
        self.o: C = None
        self.x: A = None
        self.txt = txt

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

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

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