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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: G = None
        self.p: I = None
        self.v: D = None
        self.q: G = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: I = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: B = None
        self.u: F = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: G = None
        self.p: I = None
        self.v: D = None
        self.q: G = None
        self.x: E = None
        self.t: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: I = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: B = None
        self.u: F = None
        self.s: A = None
        self.x: G = None
        self.txt = txt

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

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