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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.r: F = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.r: F = None
        self.o: F = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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