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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: H = None
        self.x: C = None
        self.w: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = 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.q: G = None
        self.x: H = None
        self.z: A = None
        self.o: F = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: B = None
        self.x: E = None
        self.v: A = None
        self.r: C = None
        self.txt = txt

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

d.s = k
d.q = h
d.r = h
d.p = h
d.o = f
d.w = l
d.u = j
d.v = n
n.q = k
n.x = k
n.r = f
n.w = d
n.u = m
k.p = j
m.s = n
l.q = h
l.x = f
l.u = f
l.z = d
l.o = g
g.x = m
g.y = d
h.u = n
h.s = n
h.q = n
h.o = g
h.z = m
h.w = l
h.v = j
f.q = d
j.o = n
j.q = n
j.x = l
j.v = d
j.r = k
assert g.x.s.r.q.v.r.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: G = None
        self.o: H = None
        self.w: E = None
        self.u: I = None
        self.r: G = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: H = None
        self.x: C = None
        self.w: A = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = 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.q: G = None
        self.x: H = None
        self.z: A = None
        self.o: F = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: B = None
        self.x: E = None
        self.v: A = None
        self.r: C = None
        self.txt = txt

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

d.s = k
d.q = h
d.r = h
d.p = h
d.o = f
d.w = l
d.u = j
d.v = n
n.q = k
n.x = k
n.r = f
n.w = d
n.u = m
k.p = j
m.s = n
l.q = h
l.x = f
l.u = f
l.z = d
l.o = g
g.x = m
g.y = d
h.u = n
h.s = n
h.q = n
h.o = g
h.z = m
h.w = l
h.v = j
f.q = d
j.o = n
j.q = n
j.x = l
j.v = d
j.r = k
assert g.x.s.r.q.v.r.q.o.txt == "f"