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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: D = None
        self.t: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

j = A("j")
d = B("d")
h = C("h")
g = D("g")
e = E("e")
l = F("l")
f = G("f")
n = H("n")
k = H("k")
a = G("a")

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: D = None
        self.t: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.w: C = None
        self.txt = txt

j = A("j")
d = B("d")
h = C("h")
g = D("g")
e = E("e")
l = F("l")
f = G("f")
n = H("n")
k = H("k")
a = G("a")

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