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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: H = None
        self.y: G = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.p: D = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: A = None
        self.z: C = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: H = None
        self.y: G = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: E = None
        self.p: D = None
        self.t: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: A = None
        self.z: C = None
        self.q: B = None
        self.txt = txt

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

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