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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: G = None
        self.s: C = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: E = None
        self.w: C = None
        self.u: D = None
        self.t: E = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

c = A("c")
e = B("e")
n = C("n")
h = D("h")
g = E("g")
d = F("d")
j = G("j")
b = B("b")

c.s = g
e.y = g
e.s = n
e.u = n
n.q = d
h.v = g
h.s = j
g.o = d
g.z = d
g.p = j
g.s = n
g.y = h
d.v = g
d.t = n
d.s = j
j.q = h
j.u = h
j.p = h
j.v = h
j.o = g
j.t = g
j.w = n
b.y = g
b.s = n
b.u = n
assert h.s.v.v.y.v.p.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: G = None
        self.s: C = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: E = None
        self.w: C = None
        self.u: D = None
        self.t: E = None
        self.p: D = None
        self.v: D = None
        self.txt = txt

c = A("c")
e = B("e")
n = C("n")
h = D("h")
g = E("g")
d = F("d")
j = G("j")
b = B("b")

c.s = g
e.y = g
e.s = n
e.u = n
n.q = d
h.v = g
h.s = j
g.o = d
g.z = d
g.p = j
g.s = n
g.y = h
d.v = g
d.t = n
d.s = j
j.q = h
j.u = h
j.p = h
j.v = h
j.o = g
j.t = g
j.w = n
b.y = g
b.s = n
b.u = n
assert h.s.v.v.y.v.p.w.q.txt == "d"