class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: I = None
        self.o: G = None
        self.v: G = None
        self.x: F = None
        self.s: H = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.o: B = None
        self.t: F = None
        self.p: F = None
        self.y: H = None
        self.q: H = None
        self.z: G = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: I = None
        self.x: H = None
        self.p: I = None
        self.o: B = None
        self.u: I = None
        self.v: I = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.q: H = None
        self.t: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: I = None
        self.o: G = None
        self.v: G = None
        self.x: F = None
        self.s: H = None
        self.y: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.o: B = None
        self.t: F = None
        self.p: F = None
        self.y: H = None
        self.q: H = None
        self.z: G = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: I = None
        self.x: H = None
        self.p: I = None
        self.o: B = None
        self.u: I = None
        self.v: I = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: B = None
        self.q: H = None
        self.t: I = None
        self.txt = txt

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

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

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

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