class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: H = None
        self.u: H = None
        self.p: G = None
        self.r: C = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: H = None
        self.u: H = None
        self.p: G = None
        self.r: C = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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