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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: B = None
        self.txt = txt

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

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

k.w = c
e.r = b
i.s = k
i.r = k
i.v = j
a.v = h
b.z = g
b.t = e
j.s = h
j.w = g
g.s = a
g.w = j
c.z = j
c.t = e
m.s = k
m.r = k
m.v = j
h.v = a
assert c.t.r.t.r.z.s.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: B = None
        self.txt = txt

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

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

k.w = c
e.r = b
i.s = k
i.r = k
i.v = j
a.v = h
b.z = g
b.t = e
j.s = h
j.w = g
g.s = a
g.w = j
c.z = j
c.t = e
m.s = k
m.r = k
m.v = j
h.v = a
assert c.t.r.t.r.z.s.v.v.txt == "a"