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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: I = None
        self.z: B = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: E = None
        self.q: F = None
        self.y: B = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: A = None
        self.v: G = None
        self.o: G = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.s: H = None
        self.o: D = None
        self.r: H = None
        self.x: H = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: A = None
        self.x: A = None
        self.w: F = None
        self.y: C = None
        self.u: A = None
        self.z: E = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: I = None
        self.z: B = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: E = None
        self.q: F = None
        self.y: B = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: A = None
        self.v: G = None
        self.o: G = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: F = None
        self.s: H = None
        self.o: D = None
        self.r: H = None
        self.x: H = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: A = None
        self.x: A = None
        self.w: F = None
        self.y: C = None
        self.u: A = None
        self.z: E = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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