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

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

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

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

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

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

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

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

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

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

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

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

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

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

k.z = g
k.o = l
k.u = l
k.s = a
k.w = a
k.y = d
g.z = f
l.x = g
l.v = n
l.s = f
l.t = f
l.y = a
l.p = k
d.q = f
d.s = f
d.o = n
d.u = n
f.z = a
f.x = n
f.o = k
j.z = g
j.w = g
j.y = a
n.q = f
n.s = f
n.o = d
n.u = d
a.z = g
a.w = g
a.y = j
assert d.o.u.q.z.y.y.w.z.txt == "f"