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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.x: C = None
        self.v: H = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.y: H = None
        self.o: D = None
        self.txt = txt

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

n = A("n")
b = B("b")
g = C("g")
m = D("m")
e = E("e")
f = F("f")
i = G("i")
h = H("h")
l = A("l")
a = B("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.x: C = None
        self.v: H = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.y: H = None
        self.o: D = None
        self.txt = txt

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

n = A("n")
b = B("b")
g = C("g")
m = D("m")
e = E("e")
f = F("f")
i = G("i")
h = H("h")
l = A("l")
a = B("a")

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