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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: D = None
        self.s: E = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.u: C = None
        self.t: H = None
        self.txt = txt

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

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

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

c = A("c")
f = B("f")
l = C("l")
i = D("i")
e = E("e")
j = F("j")
n = G("n")
d = H("d")
h = H("h")

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: D = None
        self.s: E = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.u: C = None
        self.t: H = None
        self.txt = txt

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

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

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

c = A("c")
f = B("f")
l = C("l")
i = D("i")
e = E("e")
j = F("j")
n = G("n")
d = H("d")
h = H("h")

c.p = h
c.q = e
c.w = e
c.v = e
c.s = l
c.y = l
c.t = n
c.u = f
f.r = h
f.y = i
f.s = e
f.v = n
l.w = e
l.q = n
l.v = j
i.p = l
i.v = l
i.w = j
e.y = n
e.x = n
e.u = l
e.t = h
j.u = c
j.p = l
j.y = f
n.o = j
n.v = j
d.y = f
d.t = f
d.v = j
d.p = j
d.u = h
d.s = h
d.q = i
h.y = f
h.t = f
h.v = j
h.p = j
h.u = d
h.s = d
h.q = i
assert c.w.x.o.p.q.o.txt == "j"