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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: D = None
        self.r: C = None
        self.q: A = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: D = None
        self.r: C = None
        self.q: A = None
        self.s: B = None
        self.w: C = None
        self.txt = txt

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

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

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