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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

k.w = g
k.x = i
k.s = i
g.v = j
j.w = a
j.s = a
j.y = a
j.t = k
j.u = n
j.x = h
a.r = h
n.y = g
n.u = g
h.r = g
f.w = g
f.x = i
f.s = i
i.w = g
i.x = f
i.s = f
e.w = a
e.s = a
e.y = a
e.t = k
e.u = n
e.x = h
assert f.w.v.x.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

k.w = g
k.x = i
k.s = i
g.v = j
j.w = a
j.s = a
j.y = a
j.t = k
j.u = n
j.x = h
a.r = h
n.y = g
n.u = g
h.r = g
f.w = g
f.x = i
f.s = i
i.w = g
i.x = f
i.s = f
e.w = a
e.s = a
e.y = a
e.t = k
e.u = n
e.x = h
assert f.w.v.x.r.v.txt == "j"