class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: A = None
        self.z: C = None
        self.u: D = None
        self.x: F = None
        self.q: C = None
        self.txt = txt

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

d = A("d")
i = B("i")
c = C("c")
e = D("e")
k = E("k")
g = F("g")
m = D("m")
f = C("f")
h = B("h")
n = A("n")

d.t = f
d.r = h
d.y = h
i.s = g
i.z = c
c.s = h
c.w = f
e.v = m
e.w = m
e.r = m
e.x = h
e.p = n
k.w = g
k.x = g
k.v = n
k.z = f
k.u = m
k.q = c
g.q = m
g.r = n
g.x = f
g.s = f
g.z = k
m.v = e
m.w = e
m.r = e
m.x = i
m.p = n
f.s = h
f.w = c
h.s = g
h.z = c
n.t = f
n.r = i
n.y = i
assert f.w.w.w.s.s.q.x.z.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: A = None
        self.z: C = None
        self.u: D = None
        self.x: F = None
        self.q: C = None
        self.txt = txt

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

d = A("d")
i = B("i")
c = C("c")
e = D("e")
k = E("k")
g = F("g")
m = D("m")
f = C("f")
h = B("h")
n = A("n")

d.t = f
d.r = h
d.y = h
i.s = g
i.z = c
c.s = h
c.w = f
e.v = m
e.w = m
e.r = m
e.x = h
e.p = n
k.w = g
k.x = g
k.v = n
k.z = f
k.u = m
k.q = c
g.q = m
g.r = n
g.x = f
g.s = f
g.z = k
m.v = e
m.w = e
m.r = e
m.x = i
m.p = n
f.s = h
f.w = c
h.s = g
h.z = c
n.t = f
n.r = i
n.y = i
assert f.w.w.w.s.s.q.x.z.s.z.txt == "c"