class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: F = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.s: A = None
        self.p: C = None
        self.q: B = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.u: C = None
        self.t: G = None
        self.v: D = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: H = None
        self.s: A = None
        self.p: C = None
        self.q: B = None
        self.z: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: F = None
        self.u: C = None
        self.t: G = None
        self.v: D = None
        self.s: C = None
        self.txt = txt

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

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

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