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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: A = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.w: F = None
        self.q: G = None
        self.u: B = None
        self.x: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: D = None
        self.x: G = None
        self.z: F = None
        self.v: B = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

a = A("a")
h = B("h")
m = C("m")
d = D("d")
g = E("g")
n = F("n")
f = G("f")
j = C("j")
i = G("i")

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: A = None
        self.s: C = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.w: F = None
        self.q: G = None
        self.u: B = None
        self.x: B = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: D = None
        self.x: G = None
        self.z: F = None
        self.v: B = None
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

a = A("a")
h = B("h")
m = C("m")
d = D("d")
g = E("g")
n = F("n")
f = G("f")
j = C("j")
i = G("i")

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