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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: H = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: F = None
        self.s: F = None
        self.r: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: C = None
        self.y: A = None
        self.w: C = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: H = None
        self.y: A = None
        self.u: F = None
        self.w: D = None
        self.t: C = None
        self.s: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: H = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: F = None
        self.s: F = None
        self.r: E = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: C = None
        self.y: A = None
        self.w: C = None
        self.q: F = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: H = None
        self.y: A = None
        self.u: F = None
        self.w: D = None
        self.t: C = None
        self.s: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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