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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: H = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: I = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: H = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: I = None
        self.txt = txt

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

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

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

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

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