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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.u: D = None
        self.txt = txt

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

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

a.v = n
a.p = e
g.s = a
g.x = l
g.u = k
g.t = k
g.y = e
g.r = f
k.x = g
k.z = a
k.w = e
n.z = d
n.r = k
f.p = a
f.o = n
f.u = n
l.u = g
l.r = g
l.z = n
e.u = d
e.r = g
e.z = n
d.s = a
d.x = l
d.y = l
d.u = k
d.t = k
d.r = i
i.p = a
i.o = n
i.u = n
h.p = a
h.o = n
h.u = n
assert f.u.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: D = None
        self.u: D = None
        self.txt = txt

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

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

a.v = n
a.p = e
g.s = a
g.x = l
g.u = k
g.t = k
g.y = e
g.r = f
k.x = g
k.z = a
k.w = e
n.z = d
n.r = k
f.p = a
f.o = n
f.u = n
l.u = g
l.r = g
l.z = n
e.u = d
e.r = g
e.z = n
d.s = a
d.x = l
d.y = l
d.u = k
d.t = k
d.r = i
i.p = a
i.o = n
i.u = n
h.p = a
h.o = n
h.u = n
assert f.u.z.s.txt == "a"