class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: D = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.w: E = None
        self.txt = txt

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

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

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