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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.w: D = None
        self.o: C = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: H = None
        self.z: A = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: G = None
        self.t: F = None
        self.w: I = None
        self.o: H = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: H = None
        self.y: G = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: I = None
        self.s: I = None
        self.v: E = None
        self.x: B = None
        self.y: E = None
        self.o: C = None
        self.r: E = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: G = None
        self.u: G = None
        self.w: E = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: D = None
        self.z: A = None
        self.w: A = None
        self.u: C = None
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.w: D = None
        self.o: C = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: H = None
        self.z: A = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: G = None
        self.t: F = None
        self.w: I = None
        self.o: H = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: H = None
        self.y: G = None
        self.v: A = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: I = None
        self.s: I = None
        self.v: E = None
        self.x: B = None
        self.y: E = None
        self.o: C = None
        self.r: E = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: G = None
        self.u: G = None
        self.w: E = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: D = None
        self.z: A = None
        self.w: A = None
        self.u: C = None
        self.p: A = None
        self.txt = txt

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

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