class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: G = None
        self.z: H = None
        self.v: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: B = None
        self.z: G = None
        self.t: I = None
        self.p: E = None
        self.s: A = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.q: I = None
        self.p: C = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.s: I = None
        self.q: F = None
        self.o: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: G = None
        self.z: H = None
        self.v: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: B = None
        self.z: G = None
        self.t: I = None
        self.p: E = None
        self.s: A = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: B = None
        self.q: I = None
        self.p: C = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.s: I = None
        self.q: F = None
        self.o: E = None
        self.txt = txt

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

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

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