class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.o: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: H = None
        self.y: F = None
        self.o: G = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: F = None
        self.v: A = None
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.o: A = None
        self.v: C = None
        self.r: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: F = None
        self.o: C = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: H = None
        self.y: F = None
        self.o: G = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: F = None
        self.v: A = None
        self.q: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: C = None
        self.o: A = None
        self.v: C = None
        self.r: A = None
        self.txt = txt

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

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

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