class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: G = None
        self.r: C = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: D = None
        self.o: F = None
        self.q: B = None
        self.u: D = None
        self.t: B = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: I = None
        self.x: C = None
        self.u: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.z: B = None
        self.x: F = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.q: E = None
        self.y: A = None
        self.s: A = None
        self.o: E = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: D = None
        self.o: F = None
        self.q: B = None
        self.u: D = None
        self.t: B = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: I = None
        self.x: C = None
        self.u: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: A = None
        self.z: B = None
        self.x: F = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: A = None
        self.q: E = None
        self.y: A = None
        self.s: A = None
        self.o: E = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

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

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