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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.u: D = None
        self.r: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: A = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: C = None
        self.t: I = None
        self.q: E = None
        self.u: E = None
        self.x: I = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: I = None
        self.z: E = None
        self.s: C = None
        self.q: I = None
        self.y: D = None
        self.v: D = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: A = None
        self.u: D = None
        self.r: A = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: A = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: C = None
        self.t: I = None
        self.q: E = None
        self.u: E = None
        self.x: I = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: I = None
        self.z: E = None
        self.s: C = None
        self.q: I = None
        self.y: D = None
        self.v: D = None
        self.p: C = None
        self.u: H = None
        self.txt = txt

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

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

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

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