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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.s: E = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: C = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.r: E = None
        self.v: F = None
        self.txt = txt

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

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

c.z = f
c.t = l
d.q = e
d.r = e
d.s = h
a.w = f
a.y = e
a.s = l
a.v = h
h.v = i
h.o = i
h.p = a
l.o = a
l.y = e
l.r = f
l.v = i
i.x = e
i.p = d
n.z = f
n.t = l
f.o = a
f.y = a
f.r = l
f.v = i
e.w = f
e.y = a
e.s = l
e.v = h
g.z = l
g.t = l
assert a.s.r.y.v.p.s.y.w.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.s: E = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: C = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.r: E = None
        self.v: F = None
        self.txt = txt

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

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

c.z = f
c.t = l
d.q = e
d.r = e
d.s = h
a.w = f
a.y = e
a.s = l
a.v = h
h.v = i
h.o = i
h.p = a
l.o = a
l.y = e
l.r = f
l.v = i
i.x = e
i.p = d
n.z = f
n.t = l
f.o = a
f.y = a
f.r = l
f.v = i
e.w = f
e.y = a
e.s = l
e.v = h
g.z = l
g.t = l
assert a.s.r.y.v.p.s.y.w.o.v.txt == "h"