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

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

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: I = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.t: F = None
        self.v: B = None
        self.q: E = None
        self.o: I = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: I = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.t: F = None
        self.v: B = None
        self.q: E = None
        self.o: I = None
        self.w: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: F = None
        self.txt = txt

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

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