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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: C = None
        self.s: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: B = None
        self.w: F = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.o: H = None
        self.s: C = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: B = None
        self.t: E = None
        self.s: G = None
        self.q: E = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

c = A("c")
f = B("f")
n = C("n")
j = D("j")
g = E("g")
k = F("k")
m = G("m")
h = H("h")
e = H("e")

c.r = k
c.p = k
c.q = n
c.y = n
f.p = n
n.s = k
n.z = k
j.u = c
j.t = n
j.s = e
j.w = m
g.o = m
g.u = f
g.p = f
g.w = k
k.u = m
k.o = c
k.v = n
m.z = f
m.w = k
m.o = h
m.s = n
m.r = j
h.y = c
h.z = c
h.o = f
h.t = g
h.q = g
h.s = m
h.v = k
e.y = c
e.z = c
e.o = f
e.t = g
e.q = g
e.s = m
e.v = k
assert c.r.v.s.u.w.u.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: C = None
        self.y: C = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: C = None
        self.s: H = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: B = None
        self.w: F = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: A = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: F = None
        self.o: H = None
        self.s: C = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: B = None
        self.t: E = None
        self.s: G = None
        self.q: E = None
        self.z: A = None
        self.v: F = None
        self.txt = txt

c = A("c")
f = B("f")
n = C("n")
j = D("j")
g = E("g")
k = F("k")
m = G("m")
h = H("h")
e = H("e")

c.r = k
c.p = k
c.q = n
c.y = n
f.p = n
n.s = k
n.z = k
j.u = c
j.t = n
j.s = e
j.w = m
g.o = m
g.u = f
g.p = f
g.w = k
k.u = m
k.o = c
k.v = n
m.z = f
m.w = k
m.o = h
m.s = n
m.r = j
h.y = c
h.z = c
h.o = f
h.t = g
h.q = g
h.s = m
h.v = k
e.y = c
e.z = c
e.o = f
e.t = g
e.q = g
e.s = m
e.v = k
assert c.r.v.s.u.w.u.r.s.txt == "e"