class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: C = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.v: E = None
        self.p: E = None
        self.s: F = None
        self.r: G = None
        self.x: B = None
        self.y: A = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
h = C("h")
j = D("j")
f = E("f")
i = F("i")
l = G("l")
m = H("m")
b = F("b")
k = G("k")

a.w = h
a.s = d
d.x = l
d.q = h
d.v = k
h.u = m
j.u = l
j.t = m
f.s = k
i.q = b
i.w = b
i.s = b
i.v = f
i.p = f
i.r = l
i.x = d
i.y = a
l.t = h
l.u = j
l.q = a
l.y = a
l.s = a
l.r = k
l.p = m
l.x = m
m.x = l
m.y = f
m.o = f
m.w = h
m.u = h
m.p = b
m.q = d
m.s = j
b.q = i
b.w = i
b.s = i
b.v = f
b.p = f
b.r = k
b.x = d
b.y = a
k.t = h
k.u = j
k.q = a
k.y = a
k.s = a
k.r = l
k.p = m
k.x = m
assert l.t.u.p.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: C = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.v: E = None
        self.p: E = None
        self.s: F = None
        self.r: G = None
        self.x: B = None
        self.y: A = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
h = C("h")
j = D("j")
f = E("f")
i = F("i")
l = G("l")
m = H("m")
b = F("b")
k = G("k")

a.w = h
a.s = d
d.x = l
d.q = h
d.v = k
h.u = m
j.u = l
j.t = m
f.s = k
i.q = b
i.w = b
i.s = b
i.v = f
i.p = f
i.r = l
i.x = d
i.y = a
l.t = h
l.u = j
l.q = a
l.y = a
l.s = a
l.r = k
l.p = m
l.x = m
m.x = l
m.y = f
m.o = f
m.w = h
m.u = h
m.p = b
m.q = d
m.s = j
b.q = i
b.w = i
b.s = i
b.v = f
b.p = f
b.r = k
b.x = d
b.y = a
k.t = h
k.u = j
k.q = a
k.y = a
k.s = a
k.r = l
k.p = m
k.x = m
assert l.t.u.p.s.y.s.txt == "d"