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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.s: F = None
        self.x: B = None
        self.txt = txt

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

d = A("d")
k = B("k")
f = C("f")
n = D("n")
h = E("h")
a = F("a")
c = G("c")
l = H("l")

d.s = a
d.q = n
d.p = l
k.y = d
k.u = n
k.t = n
k.q = n
k.o = c
k.p = h
k.r = f
k.w = l
f.w = a
n.o = c
n.q = a
n.v = d
n.t = l
n.s = f
n.p = k
h.y = c
a.w = k
c.w = a
c.s = a
c.y = k
c.x = k
l.u = c
l.p = c
l.y = c
l.t = d
l.x = f
assert l.u.s.w.o.w.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.s: F = None
        self.x: B = None
        self.txt = txt

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

d = A("d")
k = B("k")
f = C("f")
n = D("n")
h = E("h")
a = F("a")
c = G("c")
l = H("l")

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