class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: E = None
        self.s: F = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

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

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

d = A("d")
a = B("a")
c = C("c")
g = D("g")
h = E("h")
i = F("i")
f = G("f")
m = H("m")
b = C("b")
k = H("k")

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

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

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

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

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

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

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

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

d = A("d")
a = B("a")
c = C("c")
g = D("g")
h = E("h")
i = F("i")
f = G("f")
m = H("m")
b = C("b")
k = H("k")

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