class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: H = None
        self.q: D = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.v: H = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: C = None
        self.u: F = None
        self.o: D = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.p: B = None
        self.v: D = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.o: G = None
        self.r: A = None
        self.y: H = None
        self.s: A = None
        self.t: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: A = None
        self.x: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.v: H = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: C = None
        self.u: F = None
        self.o: D = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: C = None
        self.p: B = None
        self.v: D = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: D = None
        self.o: G = None
        self.r: A = None
        self.y: H = None
        self.s: A = None
        self.t: H = None
        self.txt = txt

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

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