class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: B = None
        self.r: D = None
        self.u: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: G = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: F = None
        self.y: E = None
        self.u: D = None
        self.r: C = None
        self.w: C = None
        self.s: I = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: G = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: F = None
        self.y: E = None
        self.u: D = None
        self.r: C = None
        self.w: C = None
        self.s: I = None
        self.v: D = None
        self.txt = txt

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

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

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

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