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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: B = None
        self.q: H = None
        self.v: C = None
        self.x: A = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: I = None
        self.s: E = None
        self.p: E = None
        self.z: I = None
        self.y: E = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: B = None
        self.q: H = None
        self.v: C = None
        self.x: A = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: I = None
        self.s: E = None
        self.p: E = None
        self.z: I = None
        self.y: E = None
        self.o: I = None
        self.txt = txt

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

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

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