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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

f = A("f")
a = B("a")
j = C("j")
e = D("e")
l = E("l")
k = F("k")
n = B("n")
b = D("b")
h = D("h")

f.p = j
f.w = l
a.r = n
a.w = n
a.v = b
a.s = e
j.x = a
j.t = k
j.u = f
j.q = f
e.s = k
e.o = k
e.z = f
e.t = f
e.q = l
l.y = f
l.v = n
k.r = e
k.w = j
k.x = j
n.r = a
n.w = a
n.v = b
n.s = b
b.s = k
b.o = k
b.z = f
b.t = f
b.q = l
h.s = k
h.o = k
h.z = f
h.t = f
h.q = l
assert f.w.v.r.s.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

f = A("f")
a = B("a")
j = C("j")
e = D("e")
l = E("l")
k = F("k")
n = B("n")
b = D("b")
h = D("h")

f.p = j
f.w = l
a.r = n
a.w = n
a.v = b
a.s = e
j.x = a
j.t = k
j.u = f
j.q = f
e.s = k
e.o = k
e.z = f
e.t = f
e.q = l
l.y = f
l.v = n
k.r = e
k.w = j
k.x = j
n.r = a
n.w = a
n.v = b
n.s = b
b.s = k
b.o = k
b.z = f
b.t = f
b.q = l
h.s = k
h.o = k
h.z = f
h.t = f
h.q = l
assert f.w.v.r.s.q.v.txt == "n"