class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: D = None
        self.x: E = None
        self.w: H = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: H = None
        self.s: A = None
        self.w: H = None
        self.u: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: D = None
        self.x: E = None
        self.w: H = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: H = None
        self.s: A = None
        self.w: H = None
        self.u: B = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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