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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: B = None
        self.u: D = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.t: E = None
        self.txt = txt

k = A("k")
j = B("j")
g = C("g")
f = D("f")
b = E("b")
a = F("a")
h = C("h")
m = F("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: B = None
        self.u: D = None
        self.t: D = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: D = None
        self.t: E = None
        self.txt = txt

k = A("k")
j = B("j")
g = C("g")
f = D("f")
b = E("b")
a = F("a")
h = C("h")
m = F("m")

k.v = b
k.y = j
k.x = j
k.s = j
j.p = k
j.y = b
g.w = b
g.t = m
g.u = k
g.x = k
g.p = a
f.q = b
f.y = k
f.z = a
b.x = k
b.s = k
b.w = j
b.u = f
b.t = f
a.r = m
a.p = f
a.t = b
h.w = b
h.t = m
h.u = k
h.x = k
h.p = a
m.r = a
m.p = f
m.t = b
assert m.r.r.p.z.r.r.r.p.txt == "f"