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

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: H = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: H = None
        self.z: A = None
        self.s: C = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: H = None
        self.s: A = None
        self.v: I = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: B = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

n = A("n")
b = B("b")
g = C("g")
d = D("d")
i = E("i")
c = F("c")
e = G("e")
a = H("a")
l = I("l")
f = J("f")

n.t = e
n.r = c
n.s = g
b.y = l
g.s = f
g.r = a
g.t = b
d.s = b
i.u = f
i.v = a
i.z = n
i.s = g
i.r = g
i.p = c
c.z = l
c.v = l
c.x = a
c.s = n
c.q = b
e.y = n
e.v = b
e.q = d
e.w = g
a.w = e
a.q = i
a.s = l
l.z = g
l.u = b
l.w = b
f.z = i
f.v = d
f.y = b
f.s = g
assert f.y.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: F = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: H = None
        self.t: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: H = None
        self.z: A = None
        self.s: C = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: H = None
        self.s: A = None
        self.v: I = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: B = None
        self.q: D = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.w: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: D = None
        self.y: B = None
        self.s: C = None
        self.txt = txt

n = A("n")
b = B("b")
g = C("g")
d = D("d")
i = E("i")
c = F("c")
e = G("e")
a = H("a")
l = I("l")
f = J("f")

n.t = e
n.r = c
n.s = g
b.y = l
g.s = f
g.r = a
g.t = b
d.s = b
i.u = f
i.v = a
i.z = n
i.s = g
i.r = g
i.p = c
c.z = l
c.v = l
c.x = a
c.s = n
c.q = b
e.y = n
e.v = b
e.q = d
e.w = g
a.w = e
a.q = i
a.s = l
l.z = g
l.u = b
l.w = b
f.z = i
f.v = d
f.y = b
f.s = g
assert f.y.y.z.txt == "g"