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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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