class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: B = None
        self.t: G = None
        self.v: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: G = None
        self.v: F = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: G = None
        self.v: F = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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