class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: A = None
        self.z: F = None
        self.s: H = None
        self.o: E = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: A = None
        self.v: E = None
        self.p: D = None
        self.r: C = None
        self.y: B = None
        self.t: D = None
        self.z: I = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: A = None
        self.z: F = None
        self.s: H = None
        self.o: E = None
        self.w: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: A = None
        self.v: E = None
        self.p: D = None
        self.r: C = None
        self.y: B = None
        self.t: D = None
        self.z: I = None
        self.txt = txt

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

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

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