class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.p: D = None
        self.s: A = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.p: D = None
        self.s: A = None
        self.r: G = None
        self.x: B = None
        self.txt = txt

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

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

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