class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: I = None
        self.r: I = None
        self.y: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: C = None
        self.y: A = None
        self.u: D = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.t: E = None
        self.r: B = None
        self.u: H = None
        self.q: I = None
        self.v: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: A = None
        self.w: B = None
        self.y: C = None
        self.s: A = None
        self.x: B = None
        self.t: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: B = None
        self.z: D = None
        self.w: A = None
        self.p: H = None
        self.r: F = None
        self.s: H = None
        self.v: D = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: C = None
        self.y: A = None
        self.u: D = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: A = None
        self.t: E = None
        self.r: B = None
        self.u: H = None
        self.q: I = None
        self.v: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: A = None
        self.w: B = None
        self.y: C = None
        self.s: A = None
        self.x: B = None
        self.t: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: B = None
        self.z: D = None
        self.w: A = None
        self.p: H = None
        self.r: F = None
        self.s: H = None
        self.v: D = None
        self.u: A = None
        self.txt = txt

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

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