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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.p: F = None
        self.r: D = None
        self.t: F = None
        self.o: A = None
        self.z: B = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.p: F = None
        self.r: D = None
        self.t: F = None
        self.o: A = None
        self.z: B = None
        self.q: E = None
        self.txt = txt

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

m.y = g
c.p = j
c.w = e
c.u = l
c.v = d
c.o = d
d.v = j
d.p = f
d.o = c
g.u = j
g.r = j
g.w = l
e.r = d
e.u = i
e.v = f
e.q = g
j.z = g
a.w = c
f.y = d
f.w = g
f.r = g
f.p = j
f.t = j
f.o = m
f.z = c
f.q = e
l.y = g
i.y = d
i.w = g
i.r = g
i.p = j
i.t = j
i.o = m
i.z = c
i.q = e
assert a.w.o.p.w.w.y.w.y.w.y.txt == "g"