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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: C = None
        self.r: C = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.q: E = None
        self.r: G = None
        self.o: G = None
        self.s: G = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.w: I = None
        self.u: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: C = None
        self.r: C = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.q: E = None
        self.r: G = None
        self.o: G = None
        self.s: G = None
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.w: I = None
        self.u: C = None
        self.txt = txt

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

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

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