class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: C = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.u: E = None
        self.z: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: E = None
        self.w: B = None
        self.x: F = None
        self.z: B = None
        self.txt = txt

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

h.p = g
h.y = n
h.u = k
j.p = a
j.y = k
j.u = k
j.z = h
j.s = d
n.y = g
n.q = h
n.u = k
n.t = a
a.y = g
a.w = h
k.x = i
k.o = g
g.w = a
g.z = h
g.t = i
i.r = a
i.y = k
i.w = j
i.x = g
i.z = d
d.p = a
d.y = k
d.u = k
d.z = h
d.s = j
assert k.x.y.o.w.w.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: C = None
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: E = None
        self.u: E = None
        self.z: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: E = None
        self.w: B = None
        self.x: F = None
        self.z: B = None
        self.txt = txt

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

h.p = g
h.y = n
h.u = k
j.p = a
j.y = k
j.u = k
j.z = h
j.s = d
n.y = g
n.q = h
n.u = k
n.t = a
a.y = g
a.w = h
k.x = i
k.o = g
g.w = a
g.z = h
g.t = i
i.r = a
i.y = k
i.w = j
i.x = g
i.z = d
d.p = a
d.y = k
d.u = k
d.z = h
d.s = j
assert k.x.y.o.w.w.y.t.txt == "a"