class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: F = None
        self.y: E = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.y: C = None
        self.u: H = None
        self.t: I = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: H = None
        self.o: G = None
        self.s: A = None
        self.r: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: B = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: E = None
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.y: C = None
        self.u: H = None
        self.t: I = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: H = None
        self.o: G = None
        self.s: A = None
        self.r: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: B = None
        self.y: G = None
        self.txt = txt

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

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